// pages/pblPage/pblPage.js
var app=getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
pbl:''
  },

  toDetail:function(e){
    let _id=e.currentTarget.dataset['index'];
    wx.navigateTo({
      url:'../detail/detail?_id=' + _id
    })
  },

  delpbl(){
    wx.showModal({
      content:"是否删除这条发布",
      success(res){
        if(res.confirm){
          //删除发布
        }
        else if(res.cancel){
          //取消删除发布
        }
      }
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
this.load_data()
  },

  load_data()
  {
    let that=this
    wx.cloud.callFunction({
      name:"getUserInfo",
      data:{
        openid:app.globalData.openid
      },
      success(res){
          console.log(res)
          console.log(res.result.data[0]['myPublish'])
          that.setData({
            pbl:res.result.data[0]['myPublish']
          })
      },
      fail(res){
        console.log("数据拉取失败",res)
      }
    })
  },
  toDetail(e){
    let _id=e.currentTarget.dataset.uid;
    wx.navigateTo({
      url:'../detail/detail?_id=' + _id
    })
  }


})